#include<iostream>  
using namespace std;  
int dp[10008];  
int main()  
{  
    int i,j,n,k;  
    cin>>n>>k;  
    for(i=2;i<=k;++i)  
        for(j=2;j<=n;++j)  
            if(j%i==0)  
            {  
                if(dp[j]==0)  
                    dp[j]=1;  
                else  
                    dp[j]=0;  
            }  
    for(i=1;i<=n;++i)  
        if(!dp[i])  
            cout<<i<<" ";  
    cout<<endl;  
    return 0;  
}